const utils = {
    toast:function(code=1,text="操作错误"){
        let div = document.createElement('div');
        div.className = 'toast';
        div.innerHTML = `
            <div class="icon">${code==0?'✔':'!'}</div>
            <div class="msg">${text}</div>
        `;
        document.body.appendChild(div);

        setTimeout(function(){
            div.remove();
        },1500)
    },
    footer(page){
        let footer = document.createElement('footer');
        footer.className = 'dpflex';
        footer.innerHTML = `
            <a href="./index.html" >
                <div class="index ${page=='index'?'color':''}">
                    <i class="iconfont icon-shouye"></i>
                    <div class="tit_index">首页</div>
                </div>
            </a>
            <a href="./sport.html">
                <div class="sport ${page=='sport'?'color':''}">
                    <i class="iconfont icon-yundong"></i>
                    <div class="tit_sport">运动</div>
                </div>
            </a>
            <a href="./mine.html">
                <div class="min ${page=='mine'?'color':''}">
                    <i class="iconfont icon-wode"></i>
                    <div class="tit">我的</div>
                </div>
            </a>
            `;
            document.body.appendChild(footer);
    }

}
//暴露
module.exports=utils;
//挂载
window.utils=utils;